<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><{$site_title}>管理中心</title>
<{include file="js.html"}>
<{include file="kindeditor.html"}>
<link type="text/css" rel="stylesheet" href="css/validator.css"></link>
<script src="js/formValidator.js" type="text/javascript"></script>
<script src="js/formValidatorRegex.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){

  //商品-》货品
  $('select:[name="position_id"]').change(function(){
    var id=$(this).val();

    $.post(
        'ajax.php?action=getSize',
        {id:id},
        function(data){
           if(data.error==0){         
               $(".size").html('宽：'+data.width+'像素；高：'+data.height+'像素');
           }  
        },'json');

  })  

 
  $("#myForm").submit(function(){
    return queding('是否保存设置？',".subCheck");
  })

})
</script>
</head>

<body>
<div class="box">
<div style="background:url(images/mainbj.jpg) repeat-x; line-height:31px; height:31px;">
<table width="262" height="31" border="0" cellpadding="0" cellspacing="0">
<tr><td width="41" align="center">
<img src="images/biao1.jpg" /></td>
<td width="221"><strong>当前位置</strong>：广告 &gt; 添加广告</td>
</tr></table>
</div>


<form action="" method="post" name="myForm" id="myForm" enctype='multipart/form-data'>
<table class="lefttab" cellpadding="0" cellspacing="0">
<tr><td colspan="3"><div style="height:26px; text-align:left; line-height:26px; background:url(images/xbj1.jpg) repeat-x; border:1px solid #e9f5fa;font-weight:bold;">&nbsp;&nbsp;添加广告</div>
</td></tr>

<tr>
  <td width="100" align="right"><font color="#e47c02">*</font> <strong>广告名称</strong>：</td>
  <td width="310" align="left">&nbsp;<input type="text" name="adv_name"  size="20" class="subCheck" value="<{$row.adv_name}>"/></td>
</tr>
<{if $row.id>0}>
<tr>
  <td width="100" align="right"><font color="#e47c02">*</font> <strong>广告位置</strong>：</td>
  <td width="310" align="left">&nbsp;<{$row.position}></td>
</tr>
<{else}>
<tr>
  <td align="right"><font color="#e47c02">*</font> <strong>广告位置</strong>：</td>
  <td align="left">&nbsp;
  <select  name="position_id"  class="subCheck">
  <option value="">请选择位置</option>
  <{foreach item=loop from=$position}>
    <option value="<{$loop.id}>" <{if $row.position_id==$loop.id}>selected<{/if}>><{$loop.position}></option>
  <{/foreach}>
  </select>
  </td>
</tr>
<{/if}>

<{if $row.id==''}>
<tr>
  <td width="100" align="right"><font color="#e47c02">*</font> <strong>图片大小</strong>：</td>
  <td width="310" align="left" class="size">&nbsp;</td>
</tr>
<{else}>
<tr>
  <td width="100" align="right"><font color="#e47c02">*</font> <strong>图片大小</strong>：</td>
  <td width="310" align="left" class="size">&nbsp;宽：<{$row.width}>像素；高：<{$row.height}>像素</td>
</tr>
<{/if}>

<tr>
  <td width="100" align="right"><font color="#e47c02">*</font> <strong>广告链接</strong>：</td>
  <td width="310" align="left">&nbsp;<input type="text" name="adv_link"  size="20" class="subCheck" value="<{$row.adv_link}>" /></td>
</tr>

<tr>
  <td align="right"><font color="#e47c02">*</font> <strong>广告图片</strong>：</td>
  <td width="673" align="left">&nbsp;<input type="file" name="adv_img" /></td>
</tr>
<{if $row.adv_img!=""}>
<tr>
  <td align="right"><font color="#e47c02">*</font> <strong>原广告图</strong>：</td>
  <td width="673" align="left">&nbsp;<a target="_blank" href="../upload/adv/large/<{$row.adv_img}>"><img src="../upload/adv/small/<{$row.adv_img}>"/></a></td>
</tr>
<{/if}>

<tr><td height="50px" colspan="2">
	<p>&nbsp;</p>
    <p align="left" style="margin-left:100px;">
      &nbsp;&nbsp;<input type="submit" name="submit" value="保存" class="inp"/>
      </p>    <p>&nbsp;</p></td>
  </tr>
</table>
</form>

</div>
</body>
</html>